/**
 * jims
 */
package com.jims.master.modules.sys.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.jims.master.common.persistence.DataEntity;
import org.hibernate.validator.constraints.Length;

import java.util.Date;

/**
 * 登录用户信息记录Entity
 * @author WangYQ
 * @version 2017-08-04
 */
public class SysLogger extends DataEntity<SysLogger> {
	
	private static final long serialVersionUID = 1L;
	private String loginname;		// 登录名
	private Date logintime;		// 登录时间
	private String ip;		// 登录IP
	private String adress;		// 登录地址
	private String way;		// 登录方式
	private User user;		// user
	private String port;		// 登录端口
	private String browser;		// 浏览器

	private String startTime;
	private String endTime;

	public String getStartTime() {
		return startTime;
	}

	public void setStartTime(String startTime) {
		this.startTime = startTime;
	}

	public String getEndTime() {
		return endTime;
	}

	public void setEndTime(String endTime) {
		this.endTime = endTime;
	}
	
	public SysLogger() {
		super();
	}

	public SysLogger(String id){
		super(id);
	}

	@Length(min=0, max=64, message="登录名长度必须介于 0 和 64 之间")
	public String getLoginname() {
		return loginname;
	}

	public void setLoginname(String loginname) {
		this.loginname = loginname;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getLogintime() {
		return logintime;
	}

	public void setLogintime(Date logintime) {
		this.logintime = logintime;
	}
	
	@Length(min=0, max=64, message="登录IP长度必须介于 0 和 64 之间")
	public String getIp() {
		return ip;
	}

	public void setIp(String ip) {
		this.ip = ip;
	}
	
	@Length(min=0, max=64, message="登录地址长度必须介于 0 和 64 之间")
	public String getAdress() {
		return adress;
	}

	public void setAdress(String adress) {
		this.adress = adress;
	}
	
	@Length(min=0, max=64, message="登录方式长度必须介于 0 和 64 之间")
	public String getWay() {
		return way;
	}

	public void setWay(String way) {
		this.way = way;
	}
	
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}
	
	@Length(min=0, max=64, message="登录端口长度必须介于 0 和 64 之间")
	public String getPort() {
		return port;
	}

	public void setPort(String port) {
		this.port = port;
	}
	
	@Length(min=0, max=64, message="浏览器长度必须介于 0 和 64 之间")
	public String getBrowser() {
		return browser;
	}

	public void setBrowser(String browser) {
		this.browser = browser;
	}
	
}